using System;
using System.IO;
using UnityEngine;
using UnityScript.Lang;

[Serializable]
public class bbquit : MonoBehaviour
{
	public AudioClip clip;

	public void Update()
	{
		if (!Input.GetKeyDown(KeyCode.Escape))
		{
			return;
		}
		int value = UnityBuiltins.parseInt((float)PlayerPrefs.GetInt("Time") + Time.realtimeSinceStartup - (float)PlayerPrefs.GetInt("LastTime"));
		PlayerPrefs.SetInt("Time", value);
		PlayerPrefs.Save();
		PlayerPrefs.Save();
		if (Directory.Exists(Application.persistentDataPath + "/adc/media/"))
		{
			DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath + "/adc/media/");
			FileInfo[] files = directoryInfo.GetFiles();
			for (int i = 0; i < Extensions.get_length((System.Array)files); i++)
			{
				if (files[i].Name.Contains("m4v"))
				{
					files[i].Delete();
				}
			}
		}
		if (Directory.Exists(Application.persistentDataPath + "/../app_webview/Cache"))
		{
			Directory.Delete(Application.persistentDataPath + "/../app_webview/Cache", recursive: true);
		}
		Invoke("Quit", 0.2f);
	}

	public void Quit()
	{
		Application.Quit();
	}

	public void Main()
	{
	}
}
